#include <iostream>

class Overload
{
	friend bool operator==(const Overload&,const Overload&);
	friend Overload& operator++(Overload&);
	friend Overload operator++(Overload&, int);
	public:
		explicit Overload(int nums = 5):num(nums){
			this->xxx++;
		}
		void print(void)const
		{
			std::cout<< this->num << "------"<<xxx <<std::endl;
		}
		static int getCount(void){
			std::cout<< xxx <<std::endl;
		}
	private:
		int num;
		static int xxx;
};
int Overload::xxx = 0;
bool operator==(const Overload& other1, const Overload& other2)
{
	return other1.num == other2.num;
}

Overload& operator++(Overload& other)
{
	other.num += 1;
	return other;
}

Overload operator++(Overload& other, int)
{
	int temp = other.num;
	other.num += 1;
	return Overload(temp);
}


int main(int argc, char **argv)
{
	Overload o1;
	o1.print();
	Overload o2(10);
	o2.print();
	if(o1 == o2)
		std::cout<< "==" <<std::endl;
	else
		std::cout<< "!=" <<std::endl;
	++o1;
	o1.print();
	Overload temp = o1++;
	temp.print();
	o1.print();
	return 0;
}
